package com.ffx.service.impl;

import com.ffx.mapper.StudentMapper;
import com.ffx.pojo.Student;
import com.ffx.service.StudentService;
import com.ffx.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class StudentServiceImpl implements StudentService {

    private StudentMapper studentMapper;
    public StudentServiceImpl(){
        //得到sqlsession
        SqlSession sqlSession = MybatisUtil.getSqlSession(true);
        studentMapper = sqlSession.getMapper(StudentMapper.class);
    }
    @Override
    public List<Student> findAll() {

        //查询学生列表
        return studentMapper.findAll();

    }
}
